1. Field
Embodiments of the invention relate to the field of traffic management; and more specifically, to the stateless forwarding of load balanced packets between clients and servers.
2. Background
In a transport protocol such as Stream Control Transmission Protocol (SCTP), Transmission Control Protocol (TCP), and User Datagram Protocol (UDP), packets are transmitted between clients and servers. One or more load balancers are positioned between the clients and servers to forward the packets. The load balancers can operate in various manners to handle packet routing. A blade is a combination of hardware and software that can act as a server and/or a client. A load balancing site is a system that includes one or more load balancers and multiple blades.
One approach to managing packets is a stateful approach using a table. To forward packets, the load balancer refers to a table to determine which blade an incoming packet to the load balancing site should forwarded to, based on which connection the packet is associated with. The table keeps a record of previous load balancing decisions of connections mapped to blades. Thus, the load balancer routes subsequent packets incoming to the load balancing site on established connections to the assigned blade in accordance with the table. For example, the table may indicate that the connection identified by “5 tuple” is mapped to the blade identified by the blade's Internet Protocol (IP) address. Therefore, when the load balancer receives an incoming packet from outside of the load balancing site on the connection “5 tuple,” then the load balancer forwards that packet to the blade marked in the table as mapped to the connection “5 tuple.”
The table-based approach to packet management has various disadvantages. Extra time and resources are required to record, maintain, and search within the table that maps the blades to connections. As more connections are established, the size of the table increases as well. In addition, if the table is lost, load balancers are not able to continue consistent routing because they do not have the information that identifies to which blades the load balancers should route the packets. Further, for a secondary load balancer to take over for a primary load balancer, the secondary load balancer also maintains its own copy of the table so that it can route packets consistent with the primary load balancer when the primary load balancer fails. However, if the secondary load balancer's table is inconsistent with the primary load balancer's table, then the secondary load balancer does not route packets consistently with the primary load balancer.
Another approach to managing packets is a stateless approach using a hash function. A load balancer applies a hash function to a connection identifier of a packet to determine to which blade the packet should be routed. For example, a load balancing site may contain N blades. To determine which of the N blades should receive an incoming packet, the hash function by the load balancer takes the source IP address of the packet as an integer and performs a modulo N of that integer. The result is an integer between 0 and N−1; the load balancer thus routes the packet to one of the N blades mapped to the blade identifier (ID) of 0 through N−1.
While the hash-based approach is stateless, it has other disadvantages. Load distribution based on a hash function does not take into account dynamic and adaptive characteristics of the blades. Traffic characteristics of the connections, such as lifetime and arrival rate, are not taken into consideration by a hash function. Adding or removing blades from the load balancing site changes a variable of the hash function. As a result, asymmetric load balancing among the blades can occur.
In view of the above, a more efficient and reliable approach to load balancing would improve connection stability for clients and servers.